Loading...
 

Printing (ASCII)

Print

With this print variant a ClassiX document is generated and filled with data. These are usually simple texts and are used for quick printing of lists or simple documents. As such documents often used to consist of directly positioned text (simple alphabet, so-called ASCII characters), the term "ASCII printing" has become commonplace. In fact, this type of printing can be used to print non-ASCII texts as well as lines and graphics. Because any font can be selected, barcodes can also be printed very easily.

One of the main features of this type of printing is that it is very easy to output a window (or part of it) to a printer. ASCII printing differs from screenshot printing in that

  • all data of a widget is printed (e.g. all lines of a list box, including those not displayed on the screen)
  • the output is plain text (buttons, scrollbars, etc. are therefore not displayed as widgets)
  • the resulting document can be further edited (e.g. by inserting additional text or graphics)

The output of print lists is controlled by a document object, which also serves as a buffer between the InstantView® instructions and the print output channel of the respective operating system. The Document object can hold the information of the entire print list - the output is explicitly triggered with PrintDocument. A preview on the screen is also possible. For very large lists, this mode is ineffective or not feasible: Here, the data is passed on to the output channel delayed by a specified number of k print pages. Depending on which mode is used, it is possible to position freely within the entire list or within the last k pages. Several document objects can exist at the same time, i.e. different print lists can be processed simultaneously.

The simple process of creating a document when printing a document usually consists of the following steps:

  1. Selection of printer and printer settings(SetPrinter,Printer Manager)
  2. Creating adocument (Document)
  3. Setting the document settings(SetParameter)
  4. Edit the document:
  5. Output of the document: Preview with ShowDocument, printing withPrintDocument, export to a text file with ExportDocument. Additionally the document can be written to an emf file(CreateEmfFiles)

SetPrinter is a very simple way to select a printer: A print dialog opens and the selected printer with its properties is used as default printer. If you want to assign defaults to the printer dialogue or save and edit the selection of the dialogue (e.g. to select printer settings only for the title page), you have to use the functionSelectPrinterWithPresets.

In order to better influence the printing process, the printing result can be influenced during document creation (step 4) using the functions of CXS_DOCUMENT. This makes it possible, for example, to automatically output different pages to different printers or to change the page format (e.g. margins or orientation) for certain pages.

The following classes are available to control printing:

As an alternative to printing with the PrintDocument command, CreatePrinterJob can also be used as a print job. This can be controlled more precisely.

See also: